package com.jiayou.Tank;

import com.jiayou.Bullet.Bullet1;
import com.jiayou.Map.Body;
import com.jiayou.tools.Constclass;

import java.awt.*;
import java.util.List;

public abstract class Model {
      public int x;
      public int y;
      public int width;
      public int heigh;
      public int speed;
      public int sw = Constclass.RIGHT;  //坦克的党项
      public Bullet1 bullet1 = null;

    public Model(int x, int y, int width, int heigh, int speed) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.heigh = heigh;
        this.speed = speed;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public Rectangle rec()
    {
        return new Rectangle((int)x,(int)y,(int)width,(int)heigh);
    }
    public abstract void draw(Graphics graphics);
    public abstract void draw(Graphics graphics, List<Body> list,Tank1 tank1);
}
